﻿from dataclasses import dataclass, field
from typing import List


@dataclass
class Task:
    id: int
    name: str
    source_dir: str
    target_dirs: List[str]
    bidirectional: bool = False
    enabled: bool = True
    running: bool = False
    synced_files: int = 0
    total_files: int = 0


@dataclass
class Settings:
    auto_start: bool = False
    check_interval: float = 1.0
    log_level: str = "INFO"
    max_log_size: int = 10 * 1024 * 1024
    ignore_patterns: List[str] = field(default_factory=lambda: [
        "*.tmp",
        "__pycache__/",
        ".git/",
        "node_modules/",
    ])


@dataclass
class AppConfig:
    tasks: List[Task] = field(default_factory=list)
    settings: Settings = field(default_factory=Settings)
